

vars <- c("Respect", "Obedient", "GoodMannered", "WellBehaved",
          "Polite", "Orderly", "Disciplined", "Loyal")


##effect size of control vs boy
CFAdata_3b<-subset(CFAdata_3, treatment==3|treatment==1)

irt_data_3b <- subset(CFAdata_3b, select = vars)

group_3b<-as.character(CFAdata_3b$treatment )

table(group_3b)
group_3b <- dplyr::recode(group_3b, "1"="Control", "2"="Girl", "3"="Boy")

mod_configural_3b<-multipleGroup( data=irt_data_3b, 
                                  model=1, 
                                  group= group_3b ) 

mod_configural_3b
summary(mod_configural_3b)
M2(mod_configural_3b)

empirical_ES(mod_configural_3b)
empirical_ES(mod_configural_3b, DIF=FALSE)

##effect size of control vs gril
CFAdata_3g<-subset(CFAdata_3, treatment==2|treatment==1)

irt_data_3g <- subset(CFAdata_3g, select = vars)

group_3g<-as.character(CFAdata_3g$treatment )

table(group_3g)
group_3g <- dplyr::recode(group_3g, "1"="Control", "2"="Girl", "3"="Boy")

mod_configural_3g<-multipleGroup( data=irt_data_3g, 
                                  model=1, 
                                  group= group_3g ) 

mod_configural_3g
summary(mod_configural_3g)
M2(mod_configural_3g)

empirical_ES(mod_configural_3g)
empirical_ES(mod_configural_3g, DIF=FALSE)


